﻿using Ninject;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Wicresoft.EKA.MVCExtensions;
using Wicresoft.EKA.ITSM.Business;

namespace Wicresoft.EKA.ITSM.Web.WebPortal.Controllers
{
    public class InspectionTaskController : BaseController
    {
        [Inject]
        public ISMGXJPlanTask SMGXJPlanTask { get; set; }

        [Inject]
        public ICTMPeople CTMPeople { get; set; }

        [Inject]
        public ISMGXJPlanTaskFrame SMGXJPlanTaskFrame { get; set; }

        [Inject]
        public override IUserInfo UserInfo { get; set; }  //每个Controller必须包含的。

        protected override void OnActionExecuting(System.Web.Mvc.ActionExecutingContext filterContext)
        {
            ((IBase)CTMPeople).UserIdentify = UserName;
            ((IBase)SMGXJPlanTask).UserIdentify = UserName;
            ((IBase)SMGXJPlanTaskFrame).UserIdentify = UserName;
            base.OnActionExecuting(filterContext);
        }

        protected override void Dispose(bool disposing)
        {
            ((IDisposable)CTMPeople).Dispose();
            ((IDisposable)SMGXJPlanTask).Dispose();
            ((IDisposable)SMGXJPlanTaskFrame).Dispose();
        }

        public ActionResult Index(string GTicketID, string PageName)
        {
            ViewBag.TicketID = GTicketID;
            ViewBag.pagename = PageName;
            //var lsit = SMGXJPlanTaskFrame.GetFrame("\'TaskID\' =  \""+GTicketID+"\"");
            return View();
        }

        public ActionResult IndexMobile(string GTicketID, string PageName)
        {
            ViewBag.TicketID = GTicketID;
            ViewBag.pagename = PageName;
            //var lsit = SMGXJPlanTaskFrame.GetFrame("\'TaskID\' =  \""+GTicketID+"\"");
            return View();
        }

        public ActionResult AbnormalIndex(string GTicketID, string PageName)
        {
            ViewBag.TicketID = GTicketID;
            ViewBag.pagename = PageName;
            //var lsit = SMGXJPlanTaskFrame.GetFrame("\'TaskID\' =  \""+GTicketID+"\"");
            return View();
        }
    }
}
